<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>perldos - Perl under DOS, W31, W95. - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/perldos">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perldos.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/perldos">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/perldos">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/perldos">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/perldos">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/perldos">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/perldos">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/perldos">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/perldos">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/perldos">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/perldos">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/perldos">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/perldos">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/perldos">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/perldos">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/perldos">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/perldos">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/perldos">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/perldos">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/perldos">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/perldos">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/perldos">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/perldos">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/perldos">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/perldos">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/perldos">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/perldos">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/perldos">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/perldos">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/perldos">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/perldos">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/perldos">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/perldos">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/perldos">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/perldos">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/perldos">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/perldos">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/perldos">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/perldos">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/perldos">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/perldos">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/perldos">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/perldos">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/perldos">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/perldos">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/perldos">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/perldos">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/perldos">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/perldos">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/perldos">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/perldos">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/perldos">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/perldos">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/perldos">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/perldos">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/perldos">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/perldos">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/perldos">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/perldos">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/perldos">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/perldos">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/perldos">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/perldos">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/perldos">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/perldos">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/perldos">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/perldos">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/perldos">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/perldos">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/perldos">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/perldos">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/perldos">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/perldos">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/perldos">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/perldos">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/perldos">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/perldos">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/perldos">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/perldos">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/perldos">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/perldos">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perldos.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/perldos">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/perldos">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/perldos">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/perldos">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/perldos">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/perldos">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/perldos">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/perldos">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/perldos">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/perldos">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/perldos">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/perldos">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/perldos">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/perldos">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/perldos">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/perldos">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/perldos">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/perldos">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/perldos">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/perldos">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/perldos">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/perldos">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/perldos">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/perldos">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/perldos">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/perldos">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/perldos">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/perldos">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/perldos">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/perldos">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/perldos">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/perldos">5.35.1</a>
          <a class="dropdown-item active" href="perldos.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perldos.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="perldos.html">perldos</a>
          <div id="more">
            (<a href="perldos.txt">source</a>,
            <a href="https://metacpan.org/pod/perldos">CPAN</a>)
          </div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="perldos.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#SYNOPSIS">SYNOPSIS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#DESCRIPTION">DESCRIPTION</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldos.html#Prerequisites-for-Compiling-Perl-on-DOS">Prerequisites for Compiling Perl on DOS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#Shortcomings-of-Perl-under-DOS">Shortcomings of Perl under DOS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#Building-Perl-on-DOS">Building Perl on DOS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#Testing-Perl-on-DOS">Testing Perl on DOS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#Installation-of-Perl-on-DOS">Installation of Perl on DOS</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#BUILDING-AND-INSTALLING-MODULES-ON-DOS">BUILDING AND INSTALLING MODULES ON DOS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldos.html#Building-Prerequisites-for-Perl-on-DOS">Building Prerequisites for Perl on DOS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#Unpacking-CPAN-Modules-on-DOS">Unpacking CPAN Modules on DOS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#Building-Non-XS-Modules-on-DOS">Building Non-XS Modules on DOS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#Building-XS-Modules-on-DOS">Building XS Modules on DOS</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#AUTHOR">AUTHOR</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldos.html#SEE-ALSO">SEE ALSO</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="perldos.html#NAME">#</a>NAME</h1>

<p>perldos - Perl under DOS, W31, W95.</p>

<h1 id="SYNOPSIS"><a class="permalink" href="perldos.html#SYNOPSIS">#</a>SYNOPSIS</h1>

<p>These are instructions for building Perl under DOS (or w??), using DJGPP v2.03 or later. Under w95 long filenames are supported.</p>

<h1 id="DESCRIPTION"><a class="permalink" href="perldos.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p>Before you start, you should glance through the README file found in the top-level directory where the Perl distribution was extracted. Make sure you read and understand the terms under which this software is being distributed.</p>

<p>This port currently supports MakeMaker (the set of modules that is used to build extensions to perl). Therefore, you should be able to build and install most extensions found in the CPAN sites.</p>

<p>Detailed instructions on how to build and install perl extension modules, including XS-type modules, is included. See &#39;BUILDING AND INSTALLING MODULES&#39;.</p>

<h2 id="Prerequisites-for-Compiling-Perl-on-DOS"><a class="permalink" href="perldos.html#Prerequisites-for-Compiling-Perl-on-DOS">#</a><a id="Prerequisites"></a>Prerequisites for Compiling Perl on DOS</h2>

<dl>

<dt id="DJGPP"><a class="permalink" href="perldos.html#DJGPP">#</a>DJGPP</dt>
<dd>

<p>DJGPP is a port of GNU C/C++ compiler and development tools to 32-bit, protected-mode environment on Intel 32-bit CPUs running MS-DOS and compatible operating systems, by DJ Delorie &lt;dj@delorie.com&gt; and friends.</p>

<p>For more details (FAQ), check out the home of DJGPP at:</p>

<pre><code class="plaintext">http://www.delorie.com/djgpp/</code></pre>

<p>If you have questions about DJGPP, try posting to the DJGPP newsgroup: comp.os.msdos.djgpp, or use the email gateway djgpp@delorie.com.</p>

<p>You can find the full DJGPP distribution on any of the mirrors listed here:</p>

<pre><code class="plaintext">http://www.delorie.com/djgpp/getting.html</code></pre>

<p>You need the following files to build perl (or add new modules):</p>

<pre><code class="plaintext">v2/djdev203.zip
v2gnu/bnu2112b.zip
v2gnu/gcc2953b.zip
v2gnu/bsh204b.zip
v2gnu/mak3791b.zip
v2gnu/fil40b.zip
v2gnu/sed3028b.zip
v2gnu/txt20b.zip
v2gnu/dif272b.zip
v2gnu/grep24b.zip
v2gnu/shl20jb.zip
v2gnu/gwk306b.zip
v2misc/csdpmi5b.zip</code></pre>

<p>or possibly any newer version.</p>

</dd>
<dt id="Pthreads"><a class="permalink" href="perldos.html#Pthreads">#</a>Pthreads</dt>
<dd>

<p>Thread support is not tested in this version of the djgpp perl.</p>

</dd>
</dl>

<h2 id="Shortcomings-of-Perl-under-DOS"><a class="permalink" href="perldos.html#Shortcomings-of-Perl-under-DOS">#</a><a id="Shortcomings"></a>Shortcomings of Perl under DOS</h2>

<p>Perl under DOS lacks some features of perl under UNIX because of deficiencies in the UNIX-emulation, most notably:</p>

<ul>

<li><p>fork() and pipe()</p>

</li>
<li><p>some features of the UNIX filesystem regarding link count and file dates</p>

</li>
<li><p>in-place operation is a little bit broken with short filenames</p>

</li>
<li><p>sockets</p>

</li>
</ul>

<h2 id="Building-Perl-on-DOS"><a class="permalink" href="perldos.html#Building-Perl-on-DOS">#</a><a id="Building"></a>Building Perl on DOS</h2>

<ul>

<li><p>Unpack the source package <i>perl5.8*.tar.gz</i> with djtarx. If you want to use long file names under w95 and also to get Perl to pass all its tests, don&#39;t forget to use</p>

<pre><code class="plaintext">set LFN=y
set FNCASE=y</code></pre>

<p>before unpacking the archive.</p>

</li>
<li><p>Create a &quot;symlink&quot; or copy your bash.exe to sh.exe in your <code>($DJDIR)/bin</code> directory.</p>

<pre><code class="plaintext">ln -s bash.exe sh.exe</code></pre>

<p>[If you have the recommended version of bash for DJGPP, this is already done for you.]</p>

<p>And make the <code>SHELL</code> environment variable point to this <i>sh.exe</i>:</p>

<pre><code class="plaintext">set SHELL=c:/djgpp/bin/sh.exe (use full path name!)</code></pre>

<p>You can do this in <i>djgpp.env</i> too. Add this line BEFORE any section definition:</p>

<pre><code>+SHELL=%DJDIR%/bin/sh.exe</code></pre>

</li>
<li><p>If you have <i>split.exe</i> and <i>gsplit.exe</i> in your path, then rename <i>split.exe</i> to <i>djsplit.exe</i>, and <i>gsplit.exe</i> to <i>split.exe</i>. Copy or link <i>gecho.exe</i> to <i>echo.exe</i> if you don&#39;t have <i>echo.exe</i>. Copy or link <i>gawk.exe</i> to <i>awk.exe</i> if you don&#39;t have <i>awk.exe</i>.</p>

<p>[If you have the recommended versions of djdev, shell utilities and gawk, all these are already done for you, and you will not need to do anything.]</p>

</li>
<li><p>Chdir to the djgpp subdirectory of perl toplevel and type the following commands:</p>

<pre><code class="plaintext">set FNCASE=y
configure.bat</code></pre>

<p>This will do some preprocessing then run the Configure script for you. The Configure script is interactive, but in most cases you just need to press ENTER. The &quot;set&quot; command ensures that DJGPP preserves the letter case of file names when reading directories. If you already issued this set command when unpacking the archive, and you are in the same DOS session as when you unpacked the archive, you don&#39;t have to issue the set command again. This command is necessary *before* you start to (re)configure or (re)build perl in order to ensure both that perl builds correctly and that building XS-type modules can succeed. See the DJGPP info entry for &quot;_preserve_fncase&quot; for more information:</p>

<pre><code class="plaintext">info libc alphabetical _preserve_fncase</code></pre>

<p>If the script says that your package is incomplete, and asks whether to continue, just answer with Y (this can only happen if you don&#39;t use long filenames or forget to issue &quot;set FNCASE=y&quot; first).</p>

<p>When Configure asks about the extensions, I suggest IO and Fcntl, and if you want database handling then SDBM_File or GDBM_File (you need to install gdbm for this one). If you want to use the POSIX extension (this is the default), make sure that the stack size of your <i>cc1.exe</i> is at least 512kbyte (you can check this with: <code>stubedit cc1.exe</code>).</p>

<p>You can use the Configure script in non-interactive mode too. When I built my <i>perl.exe</i>, I used something like this:</p>

<pre><code class="plaintext">configure.bat -des</code></pre>

<p>You can find more info about Configure&#39;s command line switches in the <i>INSTALL</i> file.</p>

<p>When the script ends, and you want to change some values in the generated <i>config.sh</i> file, then run</p>

<pre><code class="plaintext">sh Configure -S</code></pre>

<p>after you made your modifications.</p>

<p>IMPORTANT: if you use this <code>-S</code> switch, be sure to delete the CONFIG environment variable before running the script:</p>

<pre><code class="plaintext">set CONFIG=</code></pre>

</li>
<li><p>Now you can compile Perl. Type:</p>

<pre><code class="plaintext">make</code></pre>

</li>
</ul>

<h2 id="Testing-Perl-on-DOS"><a class="permalink" href="perldos.html#Testing-Perl-on-DOS">#</a><a id="Testing"></a>Testing Perl on DOS</h2>

<p>Type:</p>

<pre><code class="plaintext">make test</code></pre>

<p>If you&#39;re lucky you should see &quot;All tests successful&quot;. But there can be a few failed subtests (less than 5 hopefully) depending on some external conditions (e.g. some subtests fail under linux/dosemu or plain dos with short filenames only).</p>

<h2 id="Installation-of-Perl-on-DOS"><a class="permalink" href="perldos.html#Installation-of-Perl-on-DOS">#</a><a id="Installation"></a>Installation of Perl on DOS</h2>

<p>Type:</p>

<pre><code class="plaintext">make install</code></pre>

<p>This will copy the newly compiled perl and libraries into your DJGPP directory structure. Perl.exe and the utilities go into <code>($DJDIR)/bin</code>, and the library goes under <code>($DJDIR)/lib/perl5</code>. The pod documentation goes under <code>($DJDIR)/lib/perl5/pod</code>.</p>

<h1 id="BUILDING-AND-INSTALLING-MODULES-ON-DOS"><a class="permalink" href="perldos.html#BUILDING-AND-INSTALLING-MODULES-ON-DOS">#</a><a id="BUILDING"></a>BUILDING AND INSTALLING MODULES ON DOS</h1>

<h2 id="Building-Prerequisites-for-Perl-on-DOS"><a class="permalink" href="perldos.html#Building-Prerequisites-for-Perl-on-DOS">#</a><a id="Building1"></a>Building Prerequisites for Perl on DOS</h2>

<p>For building and installing non-XS modules, all you need is a working perl under DJGPP. Non-XS modules do not require re-linking the perl binary, and so are simpler to build and install.</p>

<p>XS-type modules do require re-linking the perl binary, because part of an XS module is written in &quot;C&quot;, and has to be linked together with the perl binary to be executed. This is required because perl under DJGPP is built with the &quot;static link&quot; option, due to the lack of &quot;dynamic linking&quot; in the DJGPP environment.</p>

<p>Because XS modules require re-linking of the perl binary, you need both the perl binary distribution and the perl source distribution to build an XS extension module. In addition, you will have to have built your perl binary from the source distribution so that all of the components of the perl binary are available for the required link step.</p>

<h2 id="Unpacking-CPAN-Modules-on-DOS"><a class="permalink" href="perldos.html#Unpacking-CPAN-Modules-on-DOS">#</a><a id="Unpacking"></a>Unpacking CPAN Modules on DOS</h2>

<p>First, download the module package from CPAN (e.g., the &quot;Comma Separated Value&quot; text package, Text-CSV-0.01.tar.gz). Then expand the contents of the package into some location on your disk. Most CPAN modules are built with an internal directory structure, so it is usually safe to expand it in the root of your DJGPP installation. Some people prefer to locate source trees under /usr/src (i.e., <code>($DJDIR)/usr/src</code>), but you may put it wherever seems most logical to you, *EXCEPT* under the same directory as your perl source code. There are special rules that apply to modules which live in the perl source tree that do not apply to most of the modules in CPAN.</p>

<p>Unlike other DJGPP packages, which are normal &quot;zip&quot; files, most CPAN module packages are &quot;gzipped tarballs&quot;. Recent versions of WinZip will safely unpack and expand them, *UNLESS* they have zero-length files. It is a known WinZip bug (as of v7.0) that it will not extract zero-length files.</p>

<p>From the command line, you can use the djtar utility provided with DJGPP to unpack and expand these files. For example:</p>

<pre><code class="plaintext">C:\djgpp&gt;djtarx -v Text-CSV-0.01.tar.gz</code></pre>

<p>This will create the new directory <code>($DJDIR)/Text-CSV-0.01</code>, filling it with the source for this module.</p>

<h2 id="Building-Non-XS-Modules-on-DOS"><a class="permalink" href="perldos.html#Building-Non-XS-Modules-on-DOS">#</a><a id="Building2"></a>Building Non-XS Modules on DOS</h2>

<p>To build a non-XS module, you can use the standard module-building instructions distributed with perl modules.</p>

<pre><code class="plaintext">perl Makefile.PL
make
make test
make install</code></pre>

<p>This is sufficient because non-XS modules install only &quot;.pm&quot; files and (sometimes) pod and/or man documentation. No re-linking of the perl binary is needed to build, install or use non-XS modules.</p>

<h2 id="Building-XS-Modules-on-DOS"><a class="permalink" href="perldos.html#Building-XS-Modules-on-DOS">#</a><a id="Building3"></a>Building XS Modules on DOS</h2>

<p>To build an XS module, you must use the standard module-building instructions distributed with perl modules *PLUS* three extra instructions specific to the DJGPP &quot;static link&quot; build environment.</p>

<pre><code class="plaintext">set FNCASE=y
perl Makefile.PL
make
make perl
make test
make -f Makefile.aperl inst_perl MAP_TARGET=perl.exe
make install</code></pre>

<p>The first extra instruction sets DJGPP&#39;s FNCASE environment variable so that the new perl binary which you must build for an XS-type module will build correctly. The second extra instruction re-builds the perl binary in your module directory before you run &quot;make test&quot;, so that you are testing with the new module code you built with &quot;make&quot;. The third extra instruction installs the perl binary from your module directory into the standard DJGPP binary directory, <code>($DJDIR)/bin</code>, replacing your previous perl binary.</p>

<p>Note that the MAP_TARGET value *must* have the &quot;.exe&quot; extension or you will not create a &quot;perl.exe&quot; to replace the one in <code>($DJDIR)/bin</code>.</p>

<p>When you are done, the XS-module install process will have added information to your &quot;perllocal&quot; information telling that the perl binary has been replaced, and what module was installed. You can view this information at any time by using the command:</p>

<pre><code class="plaintext">perl -S perldoc perllocal</code></pre>

<h1 id="AUTHOR"><a class="permalink" href="perldos.html#AUTHOR">#</a>AUTHOR</h1>

<p>Laszlo Molnar, <i>laszlo.molnar@eth.ericsson.se</i> [Installing/building perl]</p>

<p>Peter J. Farley III <i>pjfarley@banet.net</i> [Building/installing modules]</p>

<h1 id="SEE-ALSO"><a class="permalink" href="perldos.html#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1>

<p>perl(1).</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
